package com.wecan.base.PO;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.wecan.base.enums.IsNotIsStatus;
import com.wecan.base.enums.SexType;
import com.wecan.base.enums.UserStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Author liuzhihao
 * @Date 2022.01.11
 * @Version 1.0.0
 * @Description 用户表
 */
@Data
@Schema(title = "用户表")
public class User {

    @Schema(title = "用户名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String name;

    @Schema(title = "手机号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String phone;

    @Schema(title = "密码")
    @JsonIgnore
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String password;

    @Schema(title = "性别")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private SexType sex;

    @Schema(title = "生日")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long birthday;

    @Schema(title = "用户状态")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private UserStatus status;

    @Schema(title = "用户简介")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String info;

    @Schema(title = "邮箱")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String email;

    @Schema(title = "头像")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String avatar;

    @Schema(title = "等级")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal level;

    @Schema(title = "邀请者id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long invistId;

    @Schema(title = "邀请id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String wechatId;

    @Schema(title = "坑位id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long positionId;

    @Schema(title = "角色id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String roleIds;

    @Schema(title = "累计订单数量")
    private Integer orderCount;

    @Schema(title = "历史所有积分")
    private Integer allIntegral;

    @Schema(title = "积分")
    private Integer integral;

    @Schema(title = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(title = "创建日期")
    @TableField(fill = FieldFill.INSERT)
    @JsonIgnore
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long createDate;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowWatchArticles;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowWatchCollectArticles;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowWatchComments;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowNearWatch;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowWatchMyGood;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus allowWatchRaise;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private IsNotIsStatus isAuthAvatar;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal chatCharge;

    @Schema(title = "更新日期")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonIgnore
    private Long updateDate;
}
